package cloudInformation;

import cloudEntity.entity.SmartUserEntity;
import cloudEntity.entity.SmartUserRelaxDetailsEntity;
import cloudEntity.vo.news.SmartNewsVO;
import cloudInformation.mapper.SmartNewsMapper;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.lang.Snowflake;
import cn.hutool.core.util.IdUtil;
import huang.cloudUserApi.AuthFeignClient;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * @program: Smart School
 * @ClassName testApplication
 * @description:
 * @author: 陈智博
 * @create: 2025-04-14 10:20
 * @Version 1.0
 **/
@SpringBootTest
public class testApplication {

    @Autowired
    private SmartNewsMapper smartNewsMapper;

    @Autowired
    private AuthFeignClient authFeignClient;

    @Test
    public void test5()
    {
        String simpleUUID = IdUtil.simpleUUID();
        System.out.println(simpleUUID);
    }

    @Test
    public void test4()
    {
        List<SmartNewsVO> smartNewsDTOS = smartNewsMapper.GetNewsByType(1,1,5);
        smartNewsDTOS.forEach(System.out::println);
    }

    @Test
    public void test3()
    {
        SmartUserRelaxDetailsEntity relaxDetailsEntity = new SmartUserRelaxDetailsEntity();
        relaxDetailsEntity.setSysUserRelaxCreateTime(new Date());
        DateTime date = DateUtil.date();
        System.out.println(date);
    }

    @Test
    public void test() {
        SmartUserEntity smartUserEntity = authFeignClient.smartUser();
        System.out.println(smartUserEntity.toString());
    }

    @Test
    public void test1()
    {
        List<String> permissionList = new ArrayList<>();
        permissionList.add("ROLE_ADMIN");
        permissionList.add("ROLE_TEACHER");
        System.out.println(permissionList.contains("ROLE_TEACHER"));
    }


}
